import Logo from '../SidebarLogo';
import { connect } from 'react-redux';
import { AppState } from '../../store/module/app';
import { Settings } from '../../store/module/settings';
import { IStoreState } from '../../store/types';
import './index.less';

interface LayoutSideBarProps extends Settings {
    sidebar: AppState['sidebar'];
    routes: AppState['routes'];
    init: boolean;
  }

function LayoutSideBar({ theme, layout, sidebar, routes }: LayoutSideBarProps) {
    return (
        <aside>
            <div className={`layout__side-bar__logo--${layout}`}>
               <Logo opened={!sidebar.opened} layout={layout} />
           </div>
        </aside>
    )
}
export default connect(({ settings, app: { sidebar, routes, init } }: IStoreState) => ({
    ...settings,
    sidebar,
    routes,
    init,
  }))(LayoutSideBar);

